﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;

namespace SPFarmDiscovery.SPObjects
{
	public class SiteCollection: SPObjectBase
	{
		public string Url;
		public double SizeInMB;
		public int NumberOfWebs;
		public int NumberOfLists;
		public Web RootWeb;

		public SiteCollection() { }

		public SiteCollection(Web rootWeb)
		{
			this.Url = rootWeb.Url;
			this.SizeInMB = rootWeb.TotalSizeInMB;
			this.NumberOfWebs = rootWeb.TotalNumberOfSubWebs + 1;
			this.NumberOfLists = rootWeb.TotalNumberOfLists;
			this.RootWeb = rootWeb;
		}

		public override string ToString()
		{
			return this.ToXml();
		}
	}
}
